<!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>NewsHome</title>
<meta name="keywords" content="">
<meta name="description" content="">
<link rel="stylesheet" type="text/css" href="${request.contextPath}/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="${request.contextPath}/css/nprogress.css">
<link rel="stylesheet" type="text/css" href="${request.contextPath}/css/style.css">
<link rel="stylesheet" type="text/css" href="${request.contextPath}/css/font-awesome.min.css">
<link rel="shortcut icon" href="${request.contextPath}/images/favicon.ico">
<script src="${request.contextPath}/js/jquery-2.1.4.min.js"></script>
<script src="${request.contextPath}/js/nprogress.js"></script>
<script src="${request.contextPath}/js/jquery.lazyload.min.js"></script>
<!--[if gte IE 9]>
  <script src="${request.contextPath}/js/jquery-1.11.1.min.js" type="text/javascript"></script>
  <script src="${request.contextPath}/js/html5shiv.min.js" type="text/javascript"></script>
  <script src="${request.contextPath}/js/respond.min.js" type="text/javascript"></script>
  <script src="${request.contextPath}/js/selectivizr-min.js" type="text/javascript"></script>
<![endif]-->
<!--[if lt IE 9]>
  <script>window.location.href='upgrade-browser.html';</script>
<![endif]-->
</head>
<body class="user-select">
<header class="header">
<nav class="navbar navbar-default" id="navbar">
	<h2>校园新闻平台</h2>
</nav>
</header>
<section class="container">
<div class="content-wrap">
<div class="content">
  <div class="title">
	<h3>最新发布</h3>
	<div class="more">                
			<a href="/getMessage/newsstyleid/1" title="校内新闻" >校内新闻</a>
			<a href="/getMessage/newsstyleid/2" title="国际新闻" >国际新闻</a>
			<a href="/getMessage/newsstyleid/3" title="NBA资讯" >NBA资讯</a>
			<a href="/getMessage/newsstyleid/4" title="八卦消息" >八卦消息</a>
		</div>
  </div>
  <article class="excerpt excerpt-1" style="">
	  	<#list newslist as list>
            <a class="focus" href="/getMessage/newsstyleid/${list.newsstyleid}" title="" >
                <h3>
					<#if list.newsstyleid == 1>
                        校内新闻
					</#if>
					<#if list.newsstyleid == 2>
                        国际新闻
					</#if>
					<#if list.newsstyleid == 3>
                        NBA资讯
					</#if>
					<#if list.newsstyleid == 4>
                        八卦消息
					</#if>
					<#if list.newsstyleid == 0>
                        未定义新闻类型
					</#if>
				</h3>
			</a>
		<header><a class="cat" href="/getNewsMessage/nid/${list.nid}" title="" >震惊！！！<i></i></a>
			<h2><a href="/getNewsMessage/nid/${list.nid}" title="" >${list.ntitle}</a></h2>
		</header>
		<p class="meta">
			<time class="time"><i class="glyphicon glyphicon-time"></i>${list.newsdate}</time>
			<a class="comment" href="/getNewsMessage/nid/${list.nid}" title="评论" ><i class="glyphicon glyphicon-comment"></i>查看评论</a>
		</p>
		<p class="note">
			<#if showcontent == 1>
			    ${list.ncontent}
                <form id = "form1" name="form1">
					评论:<br>
					<textarea type="text" name="bbscontent" id="bbscontent"></textarea>
                    <input type="submit" name="submit" id="submit" value="确定" onclick="submitform()"/>
					<input type="hidden" name="nid" id="nid" value="${list.nid}"/>
                </form>
			</#if>
		</p>
			<br>
            <br>
		</#list>
  </article>
	<script src = "${request.contextPath}/js/jquery-1.11.0.js"></script>
	<script>
        function submitform(){
            var formData = new FormData($("#form1")[0]);//用form 表单直接 构造formData 对象; 就不需要下面的append 方法来为表单进行赋值了。
            $.ajax({
                async: false,
                url : "/inputContent",
                type : 'POST',
                data : formData,
                processData : false,  //必须false才会避开jQuery对 formdata 的默认处理
                contentType : false,  //必须false才会自动加上正确的Content-Type
                success : function(result) {
                    alert(result);
                }
            });
        }
	</script>



<#if showcontent == 1>
	<h1>评论内容</h1>
    <article class="excerpt excerpt-1" style="">
	<#list bbsInfoList as list>
	    <p>评论内容:${list.bbscontent}</p><br>
        <p>评论时间:${list.bbsdate}</p><br>
		<p>评论人:匿名</p>
		<br>
	</#list>
	</article>
</#if>
</div>
</div>
<aside class="sidebar">
<div class="fixed">
  <div class="widget widget-tabs">
	<ul class="nav nav-tabs" role="tablist">
	  <li role="presentation" class="active"><a href="#notice" aria-controls="notice" role="tab" data-toggle="tab" >公告！！！</a></li>
	  <li role="presentation"><a href="#contact" aria-controls="contact" role="tab" data-toggle="tab" >联系站长</a></li>
	</ul>
	<div class="tab-content">
	  <div role="tabpanel" class="tab-pane contact active" id="notice">
		<h3>生活不止眼前的苟且，还有远方的苟且</h3>
	  </div>
		<div role="tabpanel" class="tab-pane contact" id="contact">
		  <h2>QQ:1057309953</h2>
		  <h2>Email:zhaodongpo01@58.com</h2>
	  </div>
	</div>
  </div>
  <div class="widget widget_search">
	<form class="navbar-form" action="/Search" method="post">
	  <div class="input-group">
		<input type="text" name="keyword" class="form-control" size="35" placeholder="请输入关键字" maxlength="15" autocomplete="off">
		<span class="input-group-btn">
		<button class="btn btn-default btn-search" name="search" type="submit">搜索</button>
		</span> </div>
	</form>
  </div>
</div>
<div class="widget widget_hot">
	  <h3>最热新闻</h3>
	  <ul>
		  <#list newslist as list>
			<li><a title="" href="#" ><span class="thumbnail">
			</span><span class="text">${list.ntitle}</span><span class="muted"><i class="glyphicon glyphicon-time"></i>
				${list.newsdate}
			</span>
			</a>
			</li>
		  </#list>
	  </ul>
 </div>
</aside>
</section>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.ias.js"></script>
<script src="js/scripts.js"></script>
</body>
</html>
